<?php

class Adept_Component_Expression extends Adept_Component_Base 
{
    /**
     * @var Adept_Binding_IValue
     */
    protected $expression;
    
    public function render() 
    {
        $this->getContext()->getResponse()->write($this->expression->getValue());
    }    

    public function getExpression() 
    {
        return $this->expression;
    }
    
    public function setExpression($expression) 
    {
        if ($expression instanceof Adept_Binding_IValue) {
            $this->expression = $expression;
        } elseif (is_string($expression)) {
            $this->expression = Adept_Binding_Factory::createValueBinding($expression);
        }
    }
    
}

